package com.rotsel.mh3udb.app.ListModels;

import com.rotsel.mh3udb.app.lists.UpgradeMaterialList;
import com.rotsel.mh3udb.app.lists.WeaponList;
import com.rotsel.mh3udb.app.models.WeaponModel;

import java.util.ArrayList;

/**
 * Created by rots on 20.02.14.
 */
public class WeaponUpgradeModel {
    private int weaponId;
    public int getWeaponId(){
        return this.weaponId;
    }

    private int price;
    public int getPrice(){
        return this.price;
    }

    private int fromWeaponId;
    public int getFromWeaponId(){
        return this.fromWeaponId;
    }

    private WeaponModel weaponModel;
    public WeaponModel getWeapon(){
        if (weaponModel == null){
            weaponModel = WeaponList.getWeaponById(fromWeaponId);
        }
        return this.weaponModel;
    }

    private ArrayList<WeaponUpgradeMaterialModel> upgradeMaterials;
    public ArrayList<WeaponUpgradeMaterialModel> getUpgradeMaterials(){
        if (upgradeMaterials == null){
            upgradeMaterials = UpgradeMaterialList.getUpgradeMaterialsByWeaponId(weaponId);
        }
        return upgradeMaterials;
    }

    public WeaponUpgradeModel(int weaponId, int price, int fromWeaponId){
        this.weaponId = weaponId;
        this.price = price;
        this.fromWeaponId = fromWeaponId;
    }
}
